import http from '@/apis/utils/http'
import { Page } from '@/apis/utils/common'

export interface AdminChargerItem {
  id: string
  type: string
  deviceId: string
  voltage: number
  power: number
  latitude: number
  longitude: number
  address: string
  remark: string
}
// export interface ChargerStatusItem {
//   p: number
//   v: number
//   a: number
//   e: number
//   e2: number
//   t: number
//   h: number
// }

export const createCharger = (data: AdminChargerItem): Promise<string> =>
  http.post('/app/admin/charger/create', data)

export const updateCharger = (data: AdminChargerItem): Promise<string> =>
  http.put('/app/admin/charger/update', data)
// export const getCharger = async (id: string): Promise<ChargerItem> => {
//   return await http.get('/app/admin/' + id)
// }

// export const getChargerStatus = async (
//   id: string
// ): Promise<ChargerStatusItem> => {
//   return await http.get('/app/admin/status', {
//     params: {
//       id
//     }
//   })
// }
